package com.crm.system.controller.returnMoney;


import com.crm.common.model.DataResponse;
import com.crm.common.model.DhPageInfo;
import com.crm.common.model.DhResponse;
import com.crm.common.model.Enum.ResponseCodeEnum;
import com.crm.model.vo.returnMoney.BankFlowWhiteVO;
import com.crm.system.service.returnMoney.BankFlowWhiteListService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.List;

/**
 * 流水关联设置白名单
 */
@RestController
@RequestMapping("/bankFlow/whiteList")
@Slf4j
public class BankFlowWhiteListController {

    @Autowired
    BankFlowWhiteListService bankFlowWhiteListService;

    @PostMapping("/add")
    public DataResponse addWhiteListName(String whiteListName) {
        String responseCode = bankFlowWhiteListService.addWhiteListName(whiteListName);
        return new DhResponse(responseCode);
    }


    @GetMapping("/query")
    public DataResponse queryWhiteList(@RequestParam(value = "pageIndex", required = true) Integer pageIndex,//页码
                                       @RequestParam(value = "pageSize", required = true) Integer pageSize//分页大小
    ){
        DhPageInfo<BankFlowWhiteVO> whiteVOList = bankFlowWhiteListService.queryWhiteList(pageIndex,pageSize);
        return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),whiteVOList);
    }

}
